var verify_discountType_baseMsg = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"T1", "MSG":"","DATA":"","SCRIPTNAME":"verify_discountType"}');

if (active_discount == 1) {
    var result = null;
    if (discount_range == "cost") {
        // 如果是变更成本补差范围只能选择基于成本，补差类型只能是按库存
        if (discount_type != "stock") {
            result = '如果是变更成本补差范围只能选择基于成本，补差类型只能是按库存';
        }
    }
    else if (discount_range == "price") {
        // 如果是变更售价补差范围只能选择基于零售，补差类型为按销量
        if (discount_type != "sell") {
            result = '如果是变更售价补差范围只能选择基于零售，补差类型为按销量';
        }
    }

    if (!isNull(result)) {
        verify_discountType_baseMsg.CODE = 2;
        verify_discountType_baseMsg.ACTION = 'error';
        verify_discountType_baseMsg.MSG = result;
    }
}


JSON.stringify(verify_discountType_baseMsg);